package com.losdun.points.controller;


import com.losdun.common.core.controller.BaseController;
import com.losdun.common.core.page.TableDataInfo;
import com.losdun.points.domain.PointsRecord;
import com.losdun.points.service.PointsRecordService;
import com.losdun.weixin.security.WxSecurityUtils;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author sword.ye
 * @date 2025/4/13
 **/
@RestController
@RequestMapping("/app/pointsRecord/")
public class AppPointsRecordController extends BaseController {
    @Autowired
    private PointsRecordService pointsRecordService;

    @GetMapping("queryPointsRecordList")
    @ApiModelProperty("获取积分记录")
    public TableDataInfo queryPointsRecordList(PointsRecord pointsRecord) {
        pointsRecord.setUserId( WxSecurityUtils.getUserId());
        startPage();
        List<PointsRecord> list = pointsRecordService.queryPointsRecordList(pointsRecord);
        return getDataTable(list);
    }
}
